<link href="/res/third/layer/skin/default/layer.css" rel="stylesheet">
<link href="/res/css/common/baseAzt.css" rel="stylesheet" type="text/css" />
<link href="/res/css/common/backheadfoot.css" rel="stylesheet" type="text/css" />
<link href="/res/css/common/headfoot.css" rel="stylesheet"> 
<style>
dfn.logoIntro{
	color: #444444;
    font-size: 26px;
    vertical-align: top;
    margin-top: 20px;
    display: inline-block;
    margin-left: 15px;
}
</style>
[@front_head]
<div class="newHead fixHead">
    <div class="w1200">
        <img alt="网上采购平台" src="/res/images/common/head/logo/logoLit_03.jpg" onclick="location.href='/'" style="cursor: pointer;"/>
        <dfn class="logoIntro">帮助中心</dfn>
        <div class="comIntroOuter" style="float: right;">
        [#if Session.currentUser??]
            <div class="comIntro">
                <h6>
                    [#if Session.currentUser.company??]
                    [@content_cut content=Session.currentUser.company.companyName! len=10 ending="..." /]
                    [/#if]
                </h6>
                <h6 class="comName">${Session.currentUser.realName!} 
                </h6>
                 <ul>
                        <li class="arrow"></li>
                        <li class="myAzt" onclick="window.open('/user/userCenter')">用户中心</li>
                        [#if canSwitch]
                            [#if Session.currentRole.roleType == 1]
                                <li class="swt" onclick="switchRole()">切换到供应商</li>
                            [#else]
                                <li class="swt" onclick="switchRole()">切换到采购商</li>
                            [/#if]
                        [/#if]
                        <li class="ext" onclick="logout()">退出</li>
                    </ul>
            </div>
            <div class="comLogoOuter">
                <div class="comLogo">
                    [#if companyInfo?? && companyInfo.logo?? && companyInfo.logo != '']
                        <img alt="logo" src="${companyInfo.logo!}"/>
                    [#else]
                        <img alt="logo" src="/res/images/common/userLogo_05.png"/>
                    [/#if]
                </div>
            </div>
        [#else]
            <a href="/user/login">登录</a>
            <a class="on" style="margin-left: -3px;" href="/user/register">免费注册</a>
        [/#if]
        </div>
        <!-- <ul style="float: right;">
            <li [#if link?? && link='index']class="on"[/#if]>
            <a href="/" target="_blank">常见问题</a>
            </li>
            <li [#if link?? && link='enquiry']class="on"[/#if]>
                <a href="/enquiry/all/choose" target="_blank">联系客服</a>
            </li> 
        </ul>  -->
    </div>
</div>
[/@front_head]

<script src="/res/js/common/jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">
    function logout() {
        $.post('/user/logout', function() {
            location.replace('/');
        });
    }

    function switchRole() {
        $.post('/user/switch', function(data){
            if(data.success){
                location.replace('/');
            }else{
                alert(data.msg);
            }
        },"json");
    }
    $(".comIntroOuter a").hover(function(){
    	$(this).addClass("on");
    	$(this).siblings("a").removeClass("on");
    });
</script>
